package com.chinasofti.objectDemo3;

import java.util.Objects;

public class Test03 {
    public static void main(String[] args) {
//        Student s = new Student("李雷",50);
//        String result = Objects.toString(s);//返回参数中对象的字符串表现形式
//        System.out.println(result);
//        System.out.println(s);

        // Student s = null;
        //返回参数中对象的字符串表现形式，如果对象为空，返回第二个参数
        // String result = Objects.toString(s,"随便写一个");
        //System.out.println("result = " + result);

        // Student s = null;
        // Student s1 = new Student();
        // boolean result = Objects.isNull(s);//判断对象是否为空
        // System.out.println("result = " + result);
        Student s = null;
        boolean result = Objects.nonNull(s);//判断对象是否不为空
        System.out.println("result = " + result);

    }
}
